function judge() {
	// 获取年月日
	var year = document.getElementById('year').value - 0;
	var month = document.getElementById('month').value - 0;
	var day = document.getElementById('day').value - 0;

	// 定义每月的天数
	var jan = 31, feb = 28, mar = 31, apr = 30, may = 31, june = 30, july = 31, aug = 31, sep = 30, oct = 31, nov = 30;
	var result = 0;

	// 判断平年还是闰年
	if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
		feb = 29;
	}
	switch (month) {
		case 1: {
				// 如果case语句中有多条语句, 用花括号包起来
				result = day;
			}
			break;
		case 2:
			result = day + jan;
			break;
		case 3:
			result = day + jan + feb;
			break;
		case 4: 
			result = day + jan + feb + mar;
			break;
		case 5: 
			result = day + jan + feb + mar + apr;
			break;
		case 6: 
			result = day + jan + feb + mar + apr + may;
			break;
		case 7: 
			result = day + jan + feb + mar + apr + may + june;
			break;
		case 8: 
			result = day + jan + feb + mar + apr + may + june + july;
			break;
		case 9: 
			result = day + jan + feb + mar + apr + may + june + july + aug;
			break;
		case 10: 
			result = day + jan + feb + mar + apr + may + june + july + aug + sep;
			break;
		case 11: 
			result = day + jan + feb + mar + apr + may + june + july + aug + sep + oct;
			break;
		case 12: 
			result = day + jan + feb + mar + apr + may + june + july + aug + sep + oct + nov;
			break;

	}
	alert("该年的第" + result + "天");

}


// 判断星座
function star() {
	// 获取输入框中的值
	var month = document.getElementById('month2').value - 0;
	var day = document.getElementById('day2').value - 0;
	var result = null;
	if (month == 1) {
		result = day >= 20 ? "水瓶座" : "摩羯座";
	} else if (month == 2) {
		result = day <= 18 ? "水瓶座" : "双鱼座";
	} else if (month == 3) {
		result = day >= 21 ? "白羊座" : "双鱼座";
	} else if (month == 4) {
		result = day >= 20 ? "金牛座" : "白羊座";
	} else if (month == 5) {
		result = day >= 21 ? "双子座" : "金牛座";
	} else if (month == 6) {
		result = day >= 22 ? "巨蟹座" : "双子座";
	} else if (month == 7) {
		result = day >= 23 ? "狮子座" : "巨蟹座";
	} else if (month == 8) {
		result = day >= 23 ? "处女座" : "狮子座";
	} else if (month == 9) {
		result = day >= 23 ? "天秤座" : "处女座";
	} else if (month == 10) {
		result = day >= 24 ? "天蝎座" : "天秤座";
	} else if (month == 11) {
		result = day >= 23 ? "射手座" : "天蝎座";
	} else {
		result = day >= 22 ? "摩羯座" : "射手座";
	}
	alert("您输入的星座为: " + result);
}









